<?php defined('IN_NWIDC') or exit('Access Invalid!');?>
<link rel="stylesheet" type="text/css" href="<?php echo RESOURCE_SITE_URL;?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"  />

<div class="wrap">
  <div class="tabmenu">
    <ul class="tab pngFix">
      <li class="active">
        <a href="javascript:;">信息设置</a>
      </li>
    </ul>
  </div>
  <div class="ncm-user-profile">
    <div class="ncm-default-form fr">
      <form method="post" id="profile_form" action="index.php?act=member_proxy&op=setting">
        <input type="hidden" name="form_submit" value="ok" />
        <style>
          #profile_form dd{
            float: none;
            display: block;
          }
          #profile_form dt{
            float: none;
            display: block;
            text-align: left;
            font-size: 14px;
            font-weight: bold;
          }
          #profile_form span{
            display: block;
            float: none;
          }
          #profile_form .tips{
            color: #bbb;
          }
        </style>
        <dl>
          <dt>代理商名：</dt>
          <dd>
              <span class="w400"><?php echo $output['member_info']['member_name']; ?>&nbsp;&nbsp;
              </span>
              <span></span>
         </dd>
        </dl>

        <?php
          $m = Model();
          $info = $m->table('proxy')->where(array('member_id' => $_SESSION['member_id']))->find();
        ?>

        <dl>
          <dt>我的二维码：</dt>
          <dd>
            <span class="w400" style='color:red;font-weight:bold;'>
                <?php
                  echo base64_encode($output['member_info']['member_id'] << 16);
                ?>
            </span>
          </dd>
        </dl>

        <dl>
          <dt>代理商资料：</dt>
          <dd>
              <span class="w400">
                <textarea name="infomation" id="" cols="80" rows="60" style='height:100px;'><?php echo $info['infomation']?></textarea>
              </span>
              <span class='tips'>可填写一些常用的信息，以及对下级代理的要求等。</span>
         </dd>
        </dl>

        <dl>
          <dt>下级代理价格设置</dt>
          <dd>
            <span class='400'>
                <input type="text" style='width: 250px;' class='price_formula' name='price_formula' value='<?php echo $info['price_formula']?>' />
            </span>
            <span class='tips'>
                {current_price}表示您当前的代理价格，{max_price}表示平台价格，公式计算的总价格不得低于您的当前价格，不得高于平台价格，例如“({max_price} + {current_price}) * 0.5”
            </span>
          </dd>
        </dl>

       <dl class="bottom">
          <dt></dt>
          <dd>
            <label class="submit-border">
              <input type="submit" class="submit" value="保存">
            </label>
          </dd>
        </dl>

      </form>
    </div>
  </div>
</div>
<iframe src="" frameborder="0" style='display:none;' id='ajaxframe' name='ajaxframe'></iframe>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/common_select.js" charset="utf-8"></script>
<script type="text/javascript">
//注册表单验证
$(function(){
	regionInit("region");
	$('#birthday').datepicker({dateFormat: 'yy-mm-dd'});
    $('#profile_form').validate({
    	submitHandler:function(form){
    		if ($('select[class="valid"]').eq(0).val()>0) $('#province_id').val($('select[class="valid"]').eq(0).val());
			if ($('select[class="valid"]').eq(1).val()>0) $('#city_id').val($('select[class="valid"]').eq(1).val());
			ajaxpost('profile_form', '', '', 'onerror')
		},
        rules : {
            member_truename : {
				minlength : 2,
                maxlength : 20
            },
            member_qq : {
				digits  : true,
                minlength : 5,
                maxlength : 12
            }
        },
        messages : {
            member_truename : {
				minlength : '<?php echo $lang['home_member_username_range'];?>',
                maxlength : '<?php echo $lang['home_member_username_range'];?>'
            },
            member_qq  : {
				digits    : '<?php echo $lang['home_member_input_qq'];?>',
                minlength : '<?php echo $lang['home_member_input_qq'];?>',
                maxlength : '<?php echo $lang['home_member_input_qq'];?>'
            }
        }
    });
});
</script>
<script charset="utf-8" type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery-ui/i18n/zh-CN.js" ></script>
<script>
// <?php

// ?>
//   // var gold_formula = '<?php echo $gold_formula;?>';
//   // var base = 100;

// <?php
//   }
// ?>




</script>